package com.kancy.spring.aop;

import java.lang.reflect.Proxy;

/**
 * 生成代理类
 * @author kancy
 */
public class AopProxy {

    /**
     * 获取代理对象
     * @param bean
     * @param advice
     * @return
     */
    public static Object getProxy(Object bean, Advice advice) {
        return Proxy.newProxyInstance(AopProxy.class.getClassLoader(), bean.getClass().getInterfaces(), advice);
    }
}
